using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
using System.Web.Mvc;
namespace CoreData
{
    /// <summary>
    /// Core data class
    /// Code by: Linh Pham
    /// </summary>
    public class Merchant_Notify
    {
            public long ID{get;set;}
            public string Title { get; set; }
            public string MerchantID{get;set;}
            public string Content{get;set;}
            public DateTime CreateDate { get; set; }
            public DateTime SendDate{get;set;}
            public int Status{get;set;}
            public string Sender{get;set;}
            public bool Active{get;set;}
            public List<SelectListItem> ListMerchantExt { get; set; }
            public string[]MerchantIDExt { get; set; }
         
        public Merchant_Notify()
        {       
                    Content ="";   
                    Sender ="";
                    CreateDate = DateTime.Now;
        }
        
       static Merchant_Notify DynamicCast<T>(object row_data, object row_header) where T : Merchant_Notify
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           Merchant_Notify ret = new Merchant_Notify();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                      case  "ID":
                        ret.ID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "MerchantID":
                       ret.MerchantID = ConvertObject.ToString(dt[column]);
                       break;
                      case  "Content":
                        ret.Content = ConvertObject.ToString(dt[column]);
                       break;
                      case  "SendDate":
                        ret.SendDate = ConvertObject.ToDateTime(dt[column]);
                       break;
                      case  "Status":
                        ret.Status = ConvertObject.ToInt(dt[column]);
                       break;
                      case  "Sender":
                        ret.Sender = ConvertObject.ToString(dt[column]);
                       break;
                      case  "Active":
                        ret.Active = ConvertObject.ToBool(dt[column]);
                       break;
                   case "Title":
                       ret.Title = ConvertObject.ToString(dt[column]);
                       break;
                   case "CreateDate":
                       ret.CreateDate = ConvertObject.ToDateTime(dt[column]);
                       break;
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
